import { Component, OnInit } from '@angular/core';
import { Router, NavigationExtras, ActivatedRoute } from '@angular/router';


@Component({
  selector: 'app-page1',
  templateUrl: './page1.component.html',
  styleUrls: ['./page1.component.css']
})
export class Page1Component implements OnInit {

  constructor(
    private route: ActivatedRoute,   //接收参数  this.route能看到动态路由的参数以及url参数
    private router: Router,          //跳转
  ) {

  }


  ngOnInit() {
    console.log('ngOnInit执行了')
  }
  ngOnChanges() {
    console.log('ngOnChanges')
  }
  ngDoCheck() {
    console.log('ngDoCheck')
  }       
  ngOnDestroy() {         //销毁时
    console.log('ngOnDestroy')
  }

  ngAfterViewInit(){         //父组件视图组装完毕之后调用的
    console.log('ngAfterContentInit')
  }
  ngAfterViewChecked(){     //父组件的视图变更检测完毕
    console.log('ngAfterViewChecked')
  }
  ngAfterContentInit(){     //内容初始化到组件之后

  }
  ngAfterContentChecked(){  //内容变更检测之后

  }

}
